package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysBuyerMapper;
import com.ruoyi.system.domain.SysBuyer;
import com.ruoyi.system.service.ISysBuyerService;

/**
 * 买家Service业务层处理
 *
 * @author silencezheng
 * @date 2022-11-16
 */
@Service
public class SysBuyerServiceImpl implements ISysBuyerService
{
    @Autowired
    private SysBuyerMapper sysBuyerMapper;

    /**
     * 查询买家
     *
     * @param id 买家主键
     * @return 买家
     */
    @Override
    public SysBuyer selectSysBuyerById(Long id)
    {
        return sysBuyerMapper.selectSysBuyerById(id);
    }

    /**
     * 查询买家列表
     *
     * @param sysBuyer 买家
     * @return 买家
     */
    @Override
    public List<SysBuyer> selectSysBuyerList(SysBuyer sysBuyer)
    {
        return sysBuyerMapper.selectSysBuyerList(sysBuyer);
    }

    /**
     * 新增买家
     *
     * @param sysBuyer 买家
     * @return 结果
     */
    @Override
    public int insertSysBuyer(SysBuyer sysBuyer)
    {
        sysBuyer.setCreateTime(DateUtils.getNowDate());
        return sysBuyerMapper.insertSysBuyer(sysBuyer);
    }

    /**
     * 修改买家
     *
     * @param sysBuyer 买家
     * @return 结果
     */
    @Override
    public int updateSysBuyer(SysBuyer sysBuyer)
    {
        return sysBuyerMapper.updateSysBuyer(sysBuyer);
    }

    /**
     * 批量删除买家
     *
     * @param ids 需要删除的买家主键
     * @return 结果
     */
    @Override
    public int deleteSysBuyerByIds(Long[] ids)
    {
        return sysBuyerMapper.deleteSysBuyerByIds(ids);
    }

    /**
     * 删除买家信息
     *
     * @param id 买家主键
     * @return 结果
     */
    @Override
    public int deleteSysBuyerById(Long id)
    {
        return sysBuyerMapper.deleteSysBuyerById(id);
    }
}
